a=rand(10,4);
b=rand(4,10);
c=a*b;

a_gpu = gpuArray(a);
b_gpu = gpuArray(b);
c_gpu = gpuArray(b);
d_gpu = gpuArray(b);

blocksize = 8;
rank = 4;
[m,n] = size(c);
alpha=0.0015;
beta=0.02;

addkernel = parallel.gpu.CUDAKernel('myfun.ptx','myfun.cu');

addkernel.GridSize = [ceil(m / blocksize),ceil(m / blocksize)];
addkernel.ThreadBlockSize = [blocksize,blocksize];

[result_gpu ,result1_gpu]  = feval(addkernel,a_gpu, b_gpu, c_gpu, n, m, rank,alpha,beta);
a_after = gather(result_gpu);
b_after = gather(result1_gpu);

tt = a_after*b_after;

